local game = require "club.threecard.blackjack"
local Vector3 = CS.UnityEngine.Vector3
local one = Vector3.one
local zero = Vector3.zero


local poker = game.ui.element(game.pokerlib.core.poker)

function poker:ctor()
    self.res = "club.threecard.blackjack/ui/ingame.b:poker"
end

function poker:on_put()
    self.transform:DOKill(false)
    self.transform.localScale = one
    self.transform.localEulerAngles = zero
    self:super('on_put')
end

function poker:flip(poker_data, callback, time_length)
    time_lenght = time_lenght or 0.15;
    self.transform:DOScaleX(0, time_lenght/2)
    :OnComplete(function()
        self:set_data(poker_data);
        self.transform:DOScaleX(1, time_lenght/2)
        :OnComplete(function()
            callback();
         end)
    end)
end

return poker